PSA Object Model Diagrams

APICommonsService

global with sharing class APICommonsService

Enums

BatchJobType

Value Description
Clear FinancialForce PSA billing process to clear billing data for billing event items, billing events, budgets, expense reports, expenses milestones, miscellaneous adjustments, timecard splits and timecards.
Generate FinancialForce PSA billing process to generate billing data.
Invoice FinancialForce PSA billing process to invoice billing events.
Recalc FinancialForce PSA billing process to recalculate the billing information for unreleased billing events.
Release FinancialForce PSA billing process to release billing events.
Remove FinancialForce PSA billing process to remove billing event batches.

APICommonsService.iBatchCallback

global interface iBatchCallback

you can use the ibatchcallback global interface to hook into financialforce psa billing processes such as:
• Clear
• Generate
• Invoice
• Release
• Remove
These interface hooks are called during FinancialForce PSA billing processes and each method is called even when a process is executed inline rather than as a batch. To use these hooks, you must write classes that implement the iBatchCallback interface. Once you have written a class to handle a billing process, you must instruct FinancialForce PSA to use it. To do this, add a value containing the name of your class to the appropriate billing Interface configuration option in the Billing configuration group. For information about configuring FinancialForce PSA to use a custom billing class, see the FinancialForce PSA Help.

Methods

beforeStart

void beforeStart(APICommonsService.BatchContext bc)

This method is called before the logic of the Start method of a batch is processed.

Input Parameters

Name Type Description
bc APICommonsService.BatchContext Information about the context of the job.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

afterStart

void afterStart(APICommonsService.BatchContext bc)

This method is called after the logic of the Start method of a batch is processed.

Input Parameters

Name Type Description
bc APICommonsService.BatchContext Information about the context of the job.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

beforeExecute

void beforeExecute(APICommonsService.BatchContext bc, set<ID> scope)

This method is called before the logic of the Execute method of a batch is processed.

Input Parameters

Name Type Description
bc APICommonsService.BatchContext Information about the context of the job.
scope set<ID> Contains the IDs of the records being processed in a specific batch.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

afterExecute

void afterExecute(APICommonsService.BatchContext bc, set<ID> scope)

This method is called after the logic of the Execute method of a batch is processed.

Input Parameters

Name Type Description
bc APICommonsService.BatchContext Information about the context of the job.
scope set<ID> Contains the IDs of the records being processed in a specific batch.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

beforeFinish

void beforeFinish(APICommonsService.BatchContext bc)

This method is called before the logic of the Finish method of a batch is processed.

Input Parameters

Name Type Description
bc APICommonsService.BatchContext Information about the context of the job.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

afterFinish

void afterFinish(APICommonsService.BatchContext bc)

This method is called after the logic of the Finish method of a batch is processed.

Input Parameters

Name Type Description
bc APICommonsService.BatchContext Information about the context of the job.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

getJobType

BatchJobType getJobType()

This method must be implemented by the creator of any class that implements the iBatchCallback interface. This indicates the FinancialForce PSA billing process that the class is to intends to implement. These FinancialForce PSA billing processes all confirm that the implemented type matches their identity:
• Clear
• Generate
• Invoice
• Recalc
• Release
• Remove

Return Value

This method returns an APICommonsService.BatchJobType object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

APICommonsService.BatchContext

global abstract class BatchContext

batchcontext contains information about the context of the job. this is specific to each process and is based on the information used to launch that process.

Properties

Name Type Description
context Database.BatchableContext information about the context of the job.
jobType APICommonsService.BatchJobType action being carried out for the job.

APICommonsService.BatchStatus

global class BatchStatus

contains the status, error message and batch id of a job.

Properties

Name Type Description
status String contains the status of the api request:
• Completed means that the job was not sent to a batch, but was done inline and was successful.
• Error means that an error occurred. The error message field contains an error message.
• Batched implies that the job was successfully submitted as a batch job. The batchID contains the ID of the job.
errorMessage String action being carried out for the job.
jobID ID contains the id of the batch if it was successfully submitted as a batch. jobid must be specified if you want to retrieve the status of a batch.

Methods

BatchStatus

global BatchStatus(String status, String errorMessage, ID jobID)

© Copyright 2009–2021 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.